Skip to content

feat: cortex.py library — ledger entry with the results-index hash (results-library 5b) - #85

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/results-library-p5b-cortex
Nov 2, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/results-library-p5b-cortex

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Summary

Results-library phase 5b (closes #84). The Cortex ledger can now record which results a library or release was built from. cortex.py library <project> <index_dir> appends one fact-only entry, read from a PyAutoFit results index:

- 2026-09-03 — library — dr1 v1.0: index 6369f0eaac33 — 5 results (completed 2, failed 1, superseded 1, never_started 1)

The hash is the same sha256 autofit.export.index_hash computes, and that af.export.package writes into a release's README. So a ledger line, a package and an index can be tied together. Cortex computes the hash from the JSON, with no autofit import.

Decision flagged for your ruling — decision 65 (new entry kind library)

  • Facts only (decision 60): read from index.json and records/*.json, never inferred. It is never a result/lesson and never touches ## Now or ## Runs.
  • Written only by the verb. log --kind no longer offers library; hand-typing it exits 2.
  • One entry per call. A re-run appends another dated line; nothing is edited.
  • Smaller defaults chosen:
    • --name defaults to the index folder's name, or its parent's for .autofit_index;
    • an unknown project is refused with "not a projects.yaml key";
    • counts come from the records rather than index.json, so they agree with the hash, and a non-schema-1 index.json is refused;
    • states outside autofit's list follow, alphabetically;
    • unreadable record files are skipped, where autofit would crash on them.

API Changes

  • New verb cortex.py library <project> <index_dir> [--name NAME] [--dry-run] [--today].
  • New ledger entry kind library.
  • log --kind choices are unchanged except that library is excluded.

Test Plan

  • tests/test_library.py: 14 new tests. One builds a real index with autofit.results.ResultsIndex and checks the hash equals autofit.export.index_hash.
  • Full suite: 105 passed. cortex.py check: OK. Dashboard --check: current (no ledger changed).
  • No other organ parses ledger kinds (grep of Brain, Mind, Heart, Insight, Pulse and the assistant).

Generated by the PyAutoLabs agent workflow.

🤖 Generated with Claude Code

…esults-library 5b)

New entry kind `library` (decision 65, decide-and-flag): facts read from a
PyAutoFit results index only — sha256 equal to autofit.export.index_hash and
the state counts; written only by the verb, never `log --kind`; never a
result/lesson or ## Now. REFERENCE, AGENTS and tests (14 new).

Refs #84

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jammy2211
Jammy2211 merged commit c1b413c into main Nov 2, 2026
1 check passed
@Jammy2211
Jammy2211 deleted the feature/results-library-p5b-cortex branch November 2, 2026 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: cortex.py library — ledger entry with results-index hash (results-library 5b)

1 participant